	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>City Construction, Web Template, XHTML CSS</title>
<?php include('include/header.php'); ?>
    <div id="templatemo_banner">
    	
    </div> <!-- end of banner -->
     <div id="templatemo_content">
    
    	
        	<div class="msg_info section_w500">
	        	<h3 align="center">Send a message</h3>
				<form action="#" method="post">
					<?php if(isset($_POST['submit'])){
	$login_details="Dear Admin,<br/>

	

	Name:".$_POST['name']." <br/>

	Email:".$_POST['email']."<br/>

	
	Phone:".$_POST['phone']."<br/>
	Message:".$_POST['message']."

	";

	

	$subject =  'Contact Info';

	$bound_text = "Contact Info";

	$bound = "--".$bound_text."\r\n";

	$bound_last = "--".$bound_text."--\r\n";

	$headers = "From: MRB Construction <lvijetha90@gmail.com>\r\n";

	$headers .= "MIME-Version: 1.0\r\n"

  ."Content-Type: multipart/mixed; boundary=\"$bound_text\"";

	$message .= "If you can see this MIME than your client doesn't accept MIME types!\r\n"

	.$bound;

   

	$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"

	."Content-Transfer-Encoding: 7bit\r\n\r\n"

	.$login_details."\r\n"

	.$bound;



	if(mail('lvijetha90@gmail.com', $subject, $message,$headers)){
	echo "mail sent successfully";
	}else{
	echo "could not send your mail.";
	}
	
} ?>
				<input type="text" name="name" placeholder="*type your name" id="name">
				<input type="text" name="email" placeholder="*type your email" id="email">
				<input type="text" name="phone" placeholder="*type your number" id="phone">
				<textarea name="message" placeholder="*how can we help you?" rows="6" id="message"></textarea>
				<input type="submit" class="contact-submit-btn" value="submit">
				</form>
            </div>
      <?php $sel = mysqli_query($con, "select * from cns_pages where id= 4");
	  $res = mysqli_fetch_array($sel); 
	?>
        <div id="side_column">
        
        	<div id="quick_contact">
            	<h3><?php echo $res['title']; ?></h3>
                <?php echo htmlspecialchars_decode($res['description']); ?>
            </div>
        
        </div><!-- end of side column -->
    	<div class="cleaner"></div>
    </div> <!-- end of templatemo_content -->

<script>

$(document).ready(function(){
	$(".contact-submit-btn").click(function(){
		var name = $("#name").val();
		var email = $("#email").val();
		var phone = $("#phone").val();
		var message = $("#message").val();
		if(name == ''){
			$("#name").css('border','1px solid red');
			return false; 
		}
		if(email == ''){
			$("#email").css('border','1px solid red');
			return false; 
			
		}else{
			var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
			if( !emailReg.test( email ) ) {
			alert("enter valid email id");
				return false;
			  }
		}
		
		if(phone == ''){
			$("#phone").css('border','1px solid red');
			return false; 
		}else{
			 var phoneno = /^[0-9-+]+$/;
			  if (!phoneno.test(phone)) {
			  alert("enter valid Phone No");
					return false;
				}
				
		}
		if(message == ''){
			$("#message").css('border','1px solid red');
			return false; 
		}
	});
});
  
</script>
<?php include('include/footer.php'); ?>